<!DOCTYPE html>
<html>
  <head>
    <title>Options</title>
    <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
  </head>
  <body onload="initUI();">
    <p><button id="revoke" onclick="logout();">Revoke your OAuth token</button></p>
    <script type="text/javascript">
      var bgPage = chrome.extension.getBackgroundPage();

      function logout() {
        bgPage.logout();
        $('#revoke').get(0).disabled = true;
      }

      function initUI() {
        if (!bgPage.oauth.hasToken()) {
          $('#revoke').get(0).disabled = true;
        }
      }
    </script>
  </body>
</html>
